/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * TargetingExpressionExpressions
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class TargetingExpressionExpressions {
  /**
   * Gets or Sets type
   */
  @JsonAdapter(TypeEnum.Adapter.class)
  public enum TypeEnum {
    QUERYBROADMATCHES("queryBroadMatches"),
    
    QUERYPHRASEMATCHES("queryPhraseMatches"),
    
    QUERYEXACTMATCHES("queryExactMatches"),
    
    ASINCATEGORYSAMEAS("asinCategorySameAs"),
    
    ASINBRANDSAMEAS("asinBrandSameAs"),
    
    ASINPRICELESSTHAN("asinPriceLessThan"),
    
    ASINPRICEBETWEEN("asinPriceBetween"),
    
    ASINPRICEGREATERTHAN("asinPriceGreaterThan"),
    
    ASINREVIEWRATINGLESSTHAN("asinReviewRatingLessThan"),
    
    ASINREVIEWRATINGBETWEEN("asinReviewRatingBetween"),
    
    ASINREVIEWRATINGGREATERTHAN("asinReviewRatingGreaterThan"),
    
    ASINSAMEAS("asinSameAs"),
    
    QUERYBROADRELMATCHES("queryBroadRelMatches"),
    
    QUERYHIGHRELMATCHES("queryHighRelMatches"),
    
    ASINSUBSTITUTERELATED("asinSubstituteRelated"),
    
    ASINACCESSORYRELATED("asinAccessoryRelated");

    private String value;

    TypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static TypeEnum fromValue(String value) {
      for (TypeEnum b : TypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<TypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public TypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return TypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private List<TypeEnum> type = null;

  public static final String SERIALIZED_NAME_VALUE = "value";
  @SerializedName(SERIALIZED_NAME_VALUE)
  private String value;


  public TargetingExpressionExpressions type(List<TypeEnum> type) {
    
    this.type = type;
    return this;
  }

  public TargetingExpressionExpressions addTypeItem(TypeEnum typeItem) {
    if (this.type == null) {
      this.type = new ArrayList<TypeEnum>();
    }
    this.type.add(typeItem);
    return this;
  }

   /**
   * The type.
   * @return type
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The type.")

  public List<TypeEnum> getType() {
    return type;
  }


  public void setType(List<TypeEnum> type) {
    this.type = type;
  }


  public TargetingExpressionExpressions value(String value) {
    
    this.value = value;
    return this;
  }

   /**
   * The expression value
   * @return value
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The expression value")

  public String getValue() {
    return value;
  }


  public void setValue(String value) {
    this.value = value;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    TargetingExpressionExpressions targetingExpressionExpressions = (TargetingExpressionExpressions) o;
    return Objects.equals(this.type, targetingExpressionExpressions.type) &&
        Objects.equals(this.value, targetingExpressionExpressions.value);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, value);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class TargetingExpressionExpressions {\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    value: ").append(toIndentedString(value)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

